<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/admin/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
        .tdrow{
           font-weight: bold;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <table class="layui-table">
        <tbody>
            <tr>
                <td colspan="6" style="font-weight: bold;font-size: 16px;">
                    订单信息
                </td>
            </tr>
            <tr>
                <td><span class="tdrow">订单编号：</span>{$info.order_on}</td>
                <td><span class="tdrow">订单状态：</span>{$info.order_status_text}</td>
                <td><span class="tdrow">支付时间：</span>{$info.pay_time_text}</td>

            </tr>
            <tr>
                <td><span class="tdrow">起始地址：</span>{$info.start_address}</td>
                <td><span class="tdrow">结束地址：</span>{$info.end_address}</td>
               
            </tr>
            <tr>
                <td><span class="tdrow">代理商：</span>{$info['agent_name_text']}<a href="java:;" onclick="agent('{$info.agent_id}')"style="color: red;">点击查看</a></td>
            </tr>
        </tbody>
    </table>
    <table class="layui-table">
        <tbody>
            <tr>
                <td colspan="6" style="font-weight: bold;font-size: 16px;">资金信息</td>
            </tr>

            <tr>
                <td><span class="tdrow">配送费：</span>{$info.money}</td>
                <td><span class="tdrow">配送公里：</span>{$info.kilometre/1000}公里</td>
                <td><span class="tdrow">配送价格/公里：</span>{$info['money']/$info['kilometre']*1000}</td>
              
            </tr>
            <tr>
                <td><span class="tdrow">订单总金额：</span>{$info.money}</td>
                <td><span class="tdrow">收入金额：</span>{$info.income_money}<a href="java:;" title="订单完成后才结算" class="xuanfu">?</a>
                </td>
                <td><span class="tdrow">天气：</span>{$info.is_weather_text}</td>

            </tr>
        </tbody>
    </table>

    <table class="layui-table">
        <tbody>
            <tr>
                <td colspan="6" style="font-weight: bold;font-size: 16px;">用户信息</td>
            </tr>
            <tr>
                <td><span class="tdrow">支付状态：</span>{$info.order_status_text}</td>
                <td><span class="tdrow">收货人：</span>{$info.username}</td>
                <td><span class="tdrow">手机号：</span>{$info.phone}</td>
                <td><span class="tdrow">收货地址：</span>{$info.end_address}</td>
                <td><span class="tdrow">结束地址：</span>{$info.end_address}</td>
            </tr>

        </tbody>
    </table>
    <table class="layui-table">
        <tbody>
            <tr>
                <td colspan="6" style="font-weight: bold;font-size: 16px;">骑手信息</td>
            </tr>
            <tr>
                {if $info['rider_id'] > 0}
                <td><span class="tdrow">骑手状态：</span>{$info.rider_status}</td>
                <td><span class="tdrow">用户名：</span>{$info.rider_name}</td>
                <td><span class="tdrow">骑手接单时间：</span>{$info.rider_receiving_time_text}</td>
                <td><span class="tdrow">骑手完成时间：</span>{$info.rider_success_time_text}</td>
                {else}
                <td  style="text-align: center;"><span class="tdrow">没有骑手接单</span></td>
                {/if}
            </tr>

        </tbody>
    </table>

 
</div>
<script src="/static/admin/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/admin/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
      layui.use(['layer', 'form', 'laydate', 'element', 'upload'], function () {

        var $ = layui.$, layer = layui.layer, table = layui.table,  element = layui.element,laydate = layui.laydate, form = layui.form, upload = layui.upload;
        var indexFrame = parent.layer.getFrameIndex(window.name); //获取窗口索引

        $("#saveButton").on('click', function () {
            var loading = layer.open({ type: 3 });
            $.ajax({
                url: "{:url('add')}",
                type: 'post',
                data: $("#DataForm").serialize(),
                success: function (data) {
                    console.log(data);
                    layer.close(loading);
                    if (data.code == 0) {
                        parent.tableReload();
                        parent.layer.close(indexFrame);
                        parent.layer.msg(data.msg);
                    } else {
                        layer.msg(data.msg);
                    }
                }
            })
            return false;
        })

        $("#closeButton").on('click', function () {
            parent.layer.close(indexFrame);
        })

        // 分步表单下一步
        $(".downButton").on('click', function () {
            var id = $(".layui-this").next().attr('lay-id');
            element.tabChange('itemTab', id);
        });
        // 分步表单上一步
        $(".upButton").on('click', function () {
            var id = $(".layui-this").prev().attr('lay-id');
            element.tabChange('itemTab', id);
        });
        agent = function(id){
            var index = layer.open({
                    title: '审核信息',
                    type: 2,
                    shade: 0.2,
                    maxmin:true,
                    area: ['50%', '100%'],
                    content: "{:url('/admin/agent.agent/info')}?id="+id,
                });
                $(window).on("resize", function () {
                    layer.full(index);
                });
        }
        });
</script>
</body>
</html>